/*
PARI/GP scripts related to some polylog sequences
=============================================================
File: PolylogSequences.txt    
Link: https://oeis.org/wiki/File:PolylogSequences.txt
=============================================================
Reference link: http://dx.doi.org/10.3247/SL1Math06.002
*/


LiMinusNpDivq(nmax,p,q) =
/* ----------------------------------------------------------
  For 0 < p < q, the polylogarithm Li(-n,-p/q), multiplied
  by (p+q)^(n+1)/q, is an . This script returns the vector
  for n = 0,1,2,...,nmax (nmax+1 elements, with offset 0),
  i.e., a(n) = li(-n,-p/q)*(p+q)^(n+1)/q.

  Used to generate sequences
  A210244 to A210247, A212846 to A212847, A213127 to A213157
---------------------------------------------------------- */
{ my (v,r,p1,p2,bc,m,s);
  v = vector(nmax+1);
  v[1]=q/(p+q);
  r=-p/(p+q);
  for (i=2,nmax+1,
    p1=i-1;
    bc=1;
    m=p1;
    s=0;
    for(j=1,i-1,
      p2=j-1;
      if (p2,bc=bc*m/p2;m=m-1);
      s=s+bc*v[j]);
    v[i]=r*s);
  r=(p+q)/q;
  for(i=1,nmax+1,v[i]*=r;r*=(p+q));
  return(v);
}


/*
=============================================================
   Contributed to OEIS Wiki by Stanislav Sykora
=============================================================
*/



